//
//  ApplyLoanSelectController.swift
//  xiaoqiao
//
//  Created by 冷子豪 on 2017/7/13.
//  Copyright © 2017年 冷子豪. All rights reserved.
//

import UIKit

class ApplyLoanSelectController: UIViewController {

    @IBOutlet weak var button1: UIButton!
    @IBOutlet weak var button2: UIButton!
    @IBOutlet weak var box: CheckBox!
    @IBOutlet weak var agreeLabel: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // 点击label弹出条款
//        
//        let str = "这是一个swfit Label,用的swfit三方框架"
//        agreeLabel.layer.borderWidth = 1;
//        agreeLabel.layer.borderColor = UIColor.gray.cgColor
//        let attStr = NSMutableAttributedString.init(string: str)
//        
//        agreeLabel.attributedText = attStr
//        agreeLabel.textAlignment = NSTextAlignment.center
//        agreeLabel.yb_addAttributeTapAction(["Label"]) { (string, range, int) in
//            print("点击了\(string)标签 - {\(range.location) , \(range.length)} - \(int)")
//        }
        // MARK: 关闭点击效果 默认是开启的
//        agreeLabel.enabledTapEffect = false
    }
    
    @IBAction func clickButton1(_ sender: UIButton) {
        // 自雇人士 跳转界面 到 身份认证
        info.personType = 1
        performSegue(withIdentifier: "2loanAuth", sender: self)
    }
    @IBAction func clickButton2(_ sender: UIButton) {
        // 工薪人士 跳转界面 到 身份认证
        info.personType = 2
        performSegue(withIdentifier: "2loanAuth", sender: self)
    }
    @IBAction func boxChanged(_ sender: CheckBox) {
        if box.isChecked == true {
            button1.isEnabled = false
            button2.isEnabled = false
        } else {
            button1.isEnabled = true
            button2.isEnabled = true
        }
    }

}
